package LeetCode热题HOT100;

public class p190颠倒二进制位 {
    // you need treat n as an unsigned value
    public int reverseBits(int n) {
        int res=0;
        for (int i = 0; i <32; i++) {
            //n&1 取出当前n的最低位
            res = res<<1;
            res = res+(n&1);
            n = n>>>1;
        }

        return res;
    }
}
